package com.qing.write

import java.lang.Integer

import org.apache.spark.Partitioner

/**
  * Created by wuliao on 2017/8/21.
  */
class LucenePartitioner(num:Integer) extends Partitioner{
  override def numPartitions: Int = num

  override def getPartition(key: Any): Int = {
    key.asInstanceOf[Integer] % num
  }
}
